<html> 
<head> 
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="author" content="mengkun">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <title>花羽月FaFa巨欧小店</title>
    
    <script>
    /*
    以下内容请用专门的 Html 编辑器(如 notepad++)进行编辑，切勿直接用记事本编辑，否则可能出现中文乱码！
    */ 
    var setting = {
        /* 在以下【双引号】中粘贴QQ钱包收款链接 */ 
        // qqUrl: "https://i.qianbao.qq.com/wallet/sqrcode.htm?m=tenpay&a=1&u=3352044882&ac=CAEQ0sqwvgwYnMjA7AU%3D_xxx_sign&n=花羽月&f=wallet",
        qqUrl: "http://lunfa.gitee.io/nikki/",
        
        /* 在以下【双引号】中粘贴微信收款链接 */ 
        wechatUrl: "https://payapp.weixin.qq.com/qr/AQEF8mQgyTRvQ6WSbRq81OV5?t=GAAG#wechat_pay",
        
        /* 在以下【双引号】中粘贴支付宝收款链接 */ 
        aliUrl: "https://qr.alipay.com/fkx07583de78hpo4myx7i22",

        taobaoUrl: "https://m.intl.taobao.com/detail/detail.html?id=597697069170",
        
        // 用于动态生成二维码的API，一般不需要修改。
        qrcodeApi: "https://www.kuaizhan.com/common/encode-png?large=true&data="    
        /*
        备用二维码api：
        http://s.jiathis.com/qrcode.php?url=
        https://www.kuaizhan.com/common/encode-png?large=true&data=
        http://b.bshare.cn/barCode?site=weixin&url=
        https://api.qrserver.com/v1/create-qr-code/?size=150x150&margin=10&data=
        http://qr.topscan.com/api.php?text=
        https://bshare.optimix.asia/barCode?site=weixin&url=
        https://www.zhihu.com/qrcode?url=
        
        本多合一收款码作者 @megnkun(https://mkblog.cn)，转载请注明！
        Github： https://github.com/mengkunsoft/OneQRCode
        */
    }
    </script>
    
    <style>
    * {
        margin: 0; padding: 0;
        font-family: Microsoft yahei;
    }
    body {
        background-color: #fff;
    }
    .back{
        position: absolute;
        left:50%;
        margin-left:-200px;
        width:50px;
        height:50px;
    }
    .code-item {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        padding-bottom: 1px;
        display: none;
        background-color: #ffabde;
    }
    .code-title {
        height: 100px;
        background-color: #fff1f1;
        background-position: center;
        background-repeat: no-repeat;
        background-size: 50%;
    }
    .code-area {
        text-align: center;
    }
    .code-area>img {
        margin: 80px 0;
        width: 60%;
        min-width: 100px;
    }
    .code-footer {
        height: 80px;
        text-align: center;
        background-color: #fff;
        color: #666;
        line-height: 80px;
        font-size: 20px;
        margin: -2px 2px 2px 2px;
    }
    
    #code-all>.code-title {
        background-image: url("");
    }

    #xcode-all>.code-title {
        background-image: url("");
    }
    
    #code-qq {
        background-color: #ffd6ef;
    }
    #code-qq>.code-title {
        background-image: url("");
    }
    
    #code-wechat {
        background-color: #a8e4b7;
    }
    #code-wechat>.code-title { 
        background-color: #f6fff8;
        background-image: url("");
        
    }
    </style>    

</head>
<body>
    <div class="back">
        <img onclick="window.history.back();" src=""/>
    </div>
    <!-- 万能收款码展示区域 -->
    <div class="code-item" id="code-all">
        <div class="code-title"></div>
        <div class="code-area">
            <img id="page-url" src="">
        </div>
        <div class="code-footer">淘宝付款</div>
    </div>
    
    <!-- QQ钱包二维码展示区域 -->
    <div class="code-item" id="code-qq">
        <div class="code-title"></div>
        <div class="code-area">
            <img id="qq-url" src="">
        </div>
        <div class="code-footer">花羽月</div>
    </div>
    
    <!-- 微信二维码展示区域 -->
    <div class="code-item" id="code-wechat">
        <div class="code-title"></div>
        <div class="code-area">
            <img id="wechat-url" src="">
        </div>
        <div class="code-footer">记得+1%!</div>
    </div>
    
    <script>
    if(!(/^http(s*):\/\//.test(location.href)) || /^http(s*):\/\/localhost/.test(location.href)) {
        //alert('本收款码需要网站空间进行中转，请先部署到网站下再访问');
        // window.location.href='http://lunfa.gitee.io/pay';
    }
    
    if(navigator.userAgent.match(/Alipay/i)) {
        /* 支付宝 */ 
        window.location.href = setting.aliUrl; 
    } else if(navigator.userAgent.match(/MicroMessenger\//i)) {
        /* 微信 */ 
        document.getElementById("wechat-url").src = setting.qrcodeApi + urlEncode(setting.wechatUrl);
        document.getElementById("code-wechat").style.display = "block";
    } else if(navigator.userAgent.match(/QQ\//i)) {
        /* QQ */ 
        document.getElementById("qq-url").src = setting.qrcodeApi + urlEncode(setting.qqUrl);
        document.getElementById("code-qq").style.display = "block";
    } else {
        /* 其它，显示“万能码” */ 
        // document.getElementById("page-url").src = setting.qrcodeApi + urlEncode(window.location.href);
        // document.getElementById("page-url").src = setting.qrcodeApi + urlEncode(setting.taobaoUrl);
        // document.getElementById("code-all").style.display = "block";
        window.location.href=setting.taobaoUrl;
    }
    
    /*****************************************
     * url编码函数
     * 输入参数：待编码的字符串
     * 输出参数：编码好的
     ****************************************/
    function urlEncode(String) {
        return encodeURIComponent(String).replace(/'/g,"%27").replace(/"/g,"%22");	
    }
    </script>

</body>
</html>
